import Http from '../utils/request'

const context = process.env.VUE_APP_CONSOLE_PATH

const API = {
  couponList: '/market/couponList', // 优惠券列表
  saveOrUpdateCoupon: '/market/saveOrUpdateCoupon', // 新增优惠券
  deleteCoupon: '/market/deleteCoupon', // 删除优惠券
  invalidCoupon: '/market/saveOrUpdateCoupon', // 优惠券作废
  bingCoupon: '/market/bingCoupon', // 个人绑定优惠券
  bindGroupCoupon: '/market/bindGroupCoupon' // 团体绑定优惠券
}

/**
 * 通用接口请求方法
 * @param {*} param
 */
export const fetch = (url, param = {}, opt = {}) => Http.fetch(context + API[url], param, opt)
